<template>
    <div class="transaction_review">
        <Card class="clearfix" style="padding-bottom: 16px">
            <p slot="title">
                付款交易复核
            </p>
            <Form label-position="left" :label-width="72">
                <Row :gutter="24">
                    <i-col span="6">
                        <FormItem label="用户名称：">
                            <Input v-model="search.userName" clearable   placeholder="请输入用户名称"/>
                        </FormItem>
                    </i-col>
                    <i-col span="6">
                        <FormItem label="联系方式：">
                            <Input v-model="search.userMobile" clearable   placeholder="请输入用户联系方式"/>
                        </FormItem>
                    </i-col>
                    <i-col span="6">
                        <FormItem  label="企业类型：">
                            <Select  v-model="search.partyType"  clearable>
                                <Option  :value="1">2P</Option>
                                <Option  :value="2">4S</Option>
                                <Option  :value="3">质押监管员</Option>
                                <Option  :value="4">2B</Option>
                                <Option  :value="5">2b</Option>
                                <Option  :value="6">个人</Option>
                            </Select>
                        </FormItem>
                    </i-col>
                    <i-col span="6">
                        <FormItem label="企业名称：">
                            <Input v-model="search.partyName" clearable   placeholder="请输入企业名称"/>
                        </FormItem>
                    </i-col>
                </Row>
                <Row :gutter="24">
                    <i-col span="6">
                        <FormItem label="订单编号：">
                            <Input v-model="search.orderNo" clearable   placeholder="请输入订单编号"/>
                        </FormItem>
                    </i-col>
                    <i-col span="6">
                        <FormItem  label="充值用途：">
                            <Select  v-model="search.useWay"  clearable>
                                <Option  :value="1">定金</Option>
                                <Option  :value="2">尾款</Option>
                            </Select>
                        </FormItem>
                    </i-col>
                    <i-col span="6">
                        <FormItem label="支付类型：">
                            <Select  v-model="search.payType" clearable>
                                <Option  :value="1">支付宝</Option>
                                <Option  :value="2">微信</Option>
                                <Option  :value="3">线下</Option>
                            </Select>
                        </FormItem>
                    </i-col>
                    <i-col span="6">
                        <FormItem label="开始时间：">
                            <Date-picker type="date" placeholder="选择日期"  @on-change="search.startDate=$event"></Date-picker>
                        </FormItem>
                    </i-col>
                </Row>
                <Row :gutter="24">
                    <i-col span="6">
                        <FormItem label="结束时间：">
                            <Date-picker type="date" placeholder="选择日期"  @on-change="search.endDate=$event"></Date-picker>
                        </FormItem>
                    </i-col>
                    <i-col span="6">
                        <Button type="success"  @click="searchData" icon="ios-search" >搜索</Button>
                    </i-col>
                </Row>
            </Form>
            <br>
            <div>
                <list-table refs="table1" v-model="tableData"  :table-data="tableData" @sureHandler="getList"></list-table>
            </div>
            <Page ref="pages" :total="itemTotal" show-total style="float: right; margin-top: 20px" @on-change="getList"></Page>
        </Card>
    </div>
</template>

<script>
    import listTable from './components/listTable.vue'
    import ajax from '../../../libs/axios.js'
    export default {
        name: 'transaction_review',
        components: {
            listTable
        },
        data () {
            return {
                tableData: [],             // 表格数据集合
                itemTotal: 0,              // 条数
                search:{
                    startDate:'',          //开始时间
                    endDate:'',            //结束时间
                    payType:'',            //支付类型
                    partyName:'',          //企业名称
                    partyType:'',          //企业类型
                    userMobile:'',         //用户联系方式
                    userName:'',           //用户名称
                    orderNo:"",            // 订单编号
                    useWay:"",             // 充值用途 1.定金 2. 尾款
                    financialStatus:"2",   // 财务状态 1.已上传 2.已确认 3.交易复核  4.交易
                }
            }
        },
        mounted () {
            this.init()
        },
        activated () {
            this.init()
        },
        methods: {
            // 初始化调用
            init () {
                this.$store.commit('setActiveName', 'transactionreview');
                this.getList(1)
            },
            // 查询
            searchData () {
                this.getList(1);
            },
            // 初始化列表
            getList (page) {
                let url = 'adminlogin/financial/selectDetailInfos';
                let data = {
                    pageSize: 10,                                  // 条数
                    pageNum: page,                                 // 当前页
                    endDate:this.search.endDate,//结束时间
                    startDate: this.search.startDate,//开始时间
                    payType: this.search.payType == undefined ? "" : this.search.payType ,
                    partyName: this.search.partyName,         //企业名称
                    partyType: this.search.partyType == undefined ? "" : this.search.partyType,//企业类型
                    userMobile: this.search.userMobile,//用户联系方式
                    userName: this.search.userName,//用户名称
                    orderNo:this.search.orderNo,                   // 订单编号
                    useWay:this.search.useWay == undefined ? "" : this.search.useWay,   // 充值用途 1.定金 2. 尾款
                    financialStatus:this.search.financialStatus ,// 财务状态 1.已上传 2.已确认 3.交易复核  4.交易
                    status:0//暂时过滤未支付的订单
                }
                ajax.formRes(url, data).then(res => {
                    if (res.code == 200){
                        this.tableData=res.data;
                        this.itemTotal = res.count;
                    }else{
                        this.$Message.error('数据问题，请联系管理员');
                    }
                }).catch(err => {
                    console.log('有错误信息')
                    console.log(err)
                })
            },
        },
    }
</script>


<style lang="less">
    @import "../../../styles/common.less";
    @import "../../../styles/table.less";
</style>

